package com.oet.persistence.entity;

// Generated Feb 6, 2010 3:22:38 PM by Hibernate Tools 3.2.4.GA

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.JoinTable;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 * YdkAccount generated by hbm2java
 */
@Entity
@Table(name = "user_comment", catalog = "oet")
public class UserComment implements java.io.Serializable {

	private Long id;
	private Long courseId;
	private Long courseSeriesId;
	private Long teacherId;
	private String topic;
	private Integer type;
	private Integer level;

	private String content;
	private Date date;
	
	private Customer customer;

	public UserComment() {
	}
	
	


	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	
	@Column(name = "course_id")
	public Long getCourseId() {
		return courseId;
	}
	public void setCourseId(Long courseId) {
		this.courseId = courseId;
	}

	@Column(name = "course_series_id")
	public Long getCourseSeriesId() {
		return courseSeriesId;
	}
	public void setCourseSeriesId(Long courseSeriesId) {
		this.courseSeriesId = courseSeriesId;
	}

	
	

	@Column(name = "level")
	public Integer getLevel() {
		return level;
	}
	public void setLevel(Integer level) {
		this.level = level;
	}

	

	@Column(name = "content")
	@Lob
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	
//	@Column(name = "occupy_num")
//	public Integer getOccupyNum() {
//		return occupyNum;
//	}
//	public void setOccupyNum(Integer occupyNum) {
//		this.occupyNum = occupyNum;
//	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date")
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}


	

	@Column(name = "type")
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "teacher_id")
	public Long getTeacherId() {
		return teacherId;
	}
	public void setTeacherId(Long teacherId) {
		this.teacherId = teacherId;
	}

	@Column(name = "topic")
	public String getTopic() {
		return topic;
	}
	public void setTopic(String topic) {
		this.topic = topic;
	}

	@ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
	@JoinTable(
            name="customer_user_comment",
            joinColumns = @JoinColumn( name="user_comment_pk"),
            inverseJoinColumns = @JoinColumn( name="customer_pk")
    )
    public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}


}
